<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

class Login_model extends CI_Model{
    private $_name = 'users';
    function __construct() {
        parent::__construct();
    }
    
    /*public function validate(){
        $email = $this->security->xss_clean($this->input->post('inputEmail'));
        $password = $this->security->xss_clean($this->input->post('inputPassword'));
        
        $this->db->where('email',$email);
        $this->db->where('password',$password);                
        
        $query = $this->db->get('users');
        
        if($query->num_rows == 1)
        {
            $row = $query->row();
            $data = array(
                'user_id' => $row->user_id,
                'email' => $row->email,
                'password' => $row->password, 
                'active' => '1'
            );
            $this->session->setuserdata($data);
            return TRUE;
        }
        return FALSE;
    } */
    	
    /**
     * Get all users in DB
     * @param null
     * @return array
     */
    function a_fCheckUser( $a_UserInfo ){
    	$a_User	=	$this->db->select()
					    	->where('email', $a_UserInfo['email'])
					    	->where('password', $a_UserInfo['password'])
					    	->get($this->_name)
					    	->row_array();
    	if(count($a_User) >0){
    		return $a_User;
    	} else {
    		return false;
    	}
    }
    
    
}

?>
